<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="huoyun" uri="/huoyun" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>我的用户中心</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/theme/css/main.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/theme/css/style_userCenter.css">
	
	<script type="text/javascript" src="${pageContext.request.contextPath}/theme/js/jquery-1.6.js"></script>
  </head>
  <body>
	<div>
		<jsp:include page="../nav.jsp">
			<jsp:param value="nav_main" name="nav"/>
		</jsp:include>
	</div>
	<div class="realCer">
	
	<!--主体部分-->
	<div class="realMain clearfix mt10">
	 <!--左侧菜单-->
	<div class="realLeft" id="meunLeft">
	    <jsp:include page="../leftMenu.jsp">
	    	<jsp:param value="con_nav_main" name="con_nav"/>
	    </jsp:include>
    </div>
    <!--中由-->
	<div class="realRight ml10">
			<div class="box">
				<div class="tit">订单详情</div>
				<div class="con">
				<table class="detailTable">
					<tr>
						<td align="right" width="90">订单号：</td>
						<td><s:property value="order.orderId"/></td>
					</tr>
					<tr>
						<td align="right">订单状态：</td>
						<td>
						<s:if test="order.status == 1">
							<span>待支付</span>
							<span>
								<sec:authorize access="hasRole('ROLE_USER')"><a href="javascript:void(0);" onclick="payBond(<s:property value='order.id'/>)">支付</a></sec:authorize>
								<sec:authorize access="hasRole('ROLE_DRIVER')"><a href="">提醒货主</a></sec:authorize>
								&nbsp;|&nbsp;<a href="javascript:void(0);" onclick="cancelOrder(<s:property value='order.id'/>)">取消订单</a>
							</span>
						</s:if>
						<s:elseif test="order.status == 2">
							<span>
								待确认
							</span>
							<span>
								<sec:authorize access="hasRole('ROLE_DRIVER')"><a href="javascript:void(0);" onclick="loadCargos(<s:property value='order.id'/>)">确认交易</a></sec:authorize>
							</span>
						</s:elseif>
						<s:elseif test="order.status == 3">
							<span>
								待评价
							</span>
							<span>
								<sec:authorize access="hasRole('ROLE_USER')"><a href="javascript:void(0);" onclick="payOrder(<s:property value='order.id'/>)">评价</a></sec:authorize>
								<sec:authorize access="hasRole('ROLE_DRIVER')"><a href="">提醒货主</a></sec:authorize>
							</span>
						</s:elseif>
						<s:elseif test="order.status == 4">
							<span>
								交易完成
							</span>
							<span>
								
							</span>
						</s:elseif>
						<s:else>
							<span>
								交易关闭
							</span>
							<span>
								
							</span>
							
						</s:else>
						</td>
					</tr>
					<tr>
						<td align="right">车牌号：</td>
						<td><s:property value="order.carNumber"/></td>
					</tr>
					<tr>
						<td align="right">订单费用：</td>
						<td><s:property value="order.price"/>元</td>
					</tr>
					<tr>
						<td align="right">货物信息：</td>
						<td><s:property value="order.cargisTitle"/></td>
					</tr>
				</table>
				<s:if test="orderLogList">
				<div>
					<div><strong>订单操作日志</strong></div>
					<table class="listTable">
						<tr>
							<th>序号</th>
							<th>日志类型</th>
							<th>日志信息</th>
							<th>操作时间</th>
							<th>操作人</th>
						</tr>
						<s:iterator var="orderLog" value="orderLogList" status="st">
						<tr>
							<td><s:property value="#st.count"/></td>
							<td> 
							<s:if test="#orderLog.logType == 1">
								创建订单
							</s:if>
							<s:elseif test="#orderLog.logType == 2">
								完成了支付
							</s:elseif>
							<s:elseif test="#orderLog.logType == 3">
								完成了交易确认
							</s:elseif>
							<s:elseif test="#orderLog.logType == 4">
								完成了评论
							</s:elseif>
							</td>
							<td><s:property value="#orderLog.logInfo"/></td>
							<td><a href="#<s:property value='#orderLog.operaterId'/>"><s:property value="#orderLog.operaterName"/></a></td>
							<td><huoyun:dateFormat date="${orderLog.createTime }"/></td>
						</tr>
						</s:iterator>
					</table>
				</div>
				</s:if>
				</div>
			</div>
	</div>
	<!--中由-->
</div>
</div>
	<div>
		<jsp:include page="/footer.jsp"></jsp:include>
	</div>
    </body>
</html>